from django.conf.urls import url
from . import views

urlpatterns = [
    # 解析顺序的屏蔽效应： qs的路由屏蔽qs_hello的路由，　解决办法：$
    # url(r'^qs', views.qs, name='qs'),
    url(r'^qs$', views.qs, name='qs'),
    url(r'^qs_hello/$', views.qs_hello),

    # 未命名传参数.路由之后传参数，正则用于匹配参数
    # http://127.0.0.1:8000/demo/weather/36/
    # url(r'^demo/(\w+)/(\d+)/$', views.demo_view),

    # 命名传参
    # http://127.0.0.1:8000/demo/36/weather
    url(r'^demo/(?P<city>\d+)/(?P<weather>\w+)/$', views.demo_view),
    # http://127.0.0.1:8000/get_qs/?a=1&b=2&a=3
    url(r'get_qs/$', views.get_qs),
    url(r'get_form_data/$', views.get_form_data),
    # raw: json字符串
    # {
    # 	"a":1,
    # 	"b":2
    # }
    url(r'get_json_data/$', views.get_json_data),
    url(r'header/$', views.get_header),
    url(r'^resp/$', views.get_resp),
]